<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page session="false"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="itemController"
	class="io.ewolf.ssm.controller.ItemController" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>所有会员</title>
<script type="text/javascript">
	function queryItem() {
		document.itemForm.action = "${pageContext.request.contextPath }/item/queryItem.action";
		document.itemForm.submit();
	}
	function editItemAllSubmit() {
		document.itemForm.action = "${pageContext.request.contextPath }/item/editItemAllSubmit.action";
		document.itemForm.submit();
	}
</script>
</head>
<body>
	<form name="itemForm" action="${pageContext.request.contextPath }/item/queryItem.action" method="post">
		查询条件：
		<table style="test-align: left; width: 100%;" border="1">
			<tr>
				<td>商品名称：<input name="itemCustom.itemname"></td>
				<td><input type="button" value="查询" onclick="queryItem()" /> 
					<input type="button" value="批量修改提交" onclick="editItemAllSubmit()" /></td>
			</tr>
		</table>
		商品列表：
		<table style="test-align: left; width: 100%;" border="1">
			<tr>
				<td>商品名称</td>
				<td>颜色</td>
				<td>生产日期</td>
				<td>产地</td>
				<td>商品简介</td>
				<td>orderdetail_id</td>
			</tr>

			<c:forEach var="item" items="${itemList}" varStatus="status">
				<input type="hidden" name="itemList[${status.index}].id" value="${item.id}"> 
				<tr>
					<td><input name="itemList[${status.index}].itemname" value="${item.itemname}" /></td>
					<td><input name="itemList[${status.index}].color" value="${item.color}" /></td>
					<td><input name="itemList[${status.index}].producetime"
						value="<fmt:formatDate value="${item.producetime}" pattern="yyyy-MM-dd HH:mm:ss" />" /></td>
					<td><input name="itemList[${status.index}].produceaddress" value="${item.produceaddress}" /></td>
					<td><input name="itemList[${status.index}].detail" value="${item.detail}" /></td>
					<td><input name="itemList[${status.index}].orderdetail_id" value="${item.orderdetail_id}" /></td>
				</tr>
			</c:forEach>
		</table>

	</form>

</body>
</html>